home *** CD-ROM | disk | FTP | other *** search
File List | 1994-01-03 | 1.3 KB | 82 lines |
- '
- ' PlutDay (c) 1994 by Peter Deane (3:622/401)
- '
- ' Gives the day number of system's date.
- '
- ' ALL rights reserved. Any use of any part of this source must be
- ' acknowledged to Peter Deane
- '
- versnum$="1.1"
- versdate$="03-Jan-94"
- '
- MODE 0
- '
- dt$=DATE$
- '
- date.1$=LEFT$(dt$,2)
- date.2$=MID$(dt$,4,2)
- date.3$=RIGHT$(dt$,4)
- '
- day%=VAL(date.1$)
- month%=VAL(date.2$)
- year%=VAL(date.3$)
- '
- xx%=year% MOD 4
- '
- ' NB this will ONLY work for the years 1901- 2099. It will fail in 2100,
- ' and 1900 because they are NOT a leap years!
- '
- ' (Actually, it will work for every year except: 100AD, 200AD, 300AD, 500AD,
- ' 600AD, 700AD, 900AD, 1000AD, 1100AD, etc)
- '
- IF xx%=0
- leapadd!=TRUE
- ELSE
- leapadd!=FALSE
- ENDIF
- '
- SELECT month%
- '
- CASE 1
- daynum%=day%+0
- leapadd!=FALSE
- CASE 2
- daynum%=day%+31
- leapadd!=FALSE
- CASE 3
- daynum%=day%+59
- CASE 4
- daynum%=day%+90
- CASE 5
- daynum%=day%+120
- CASE 6
- daynum%=day%+151
- CASE 7
- daynum%=day%+181
- CASE 8
- daynum%=day%+212
- CASE 9
- daynum%=day%+243
- CASE 10
- daynum%=day%+273
- CASE 11
- daynum%=day%+304
- CASE 12
- daynum%=day%+334
- DEFAULT
- daynum%=day%+0
- ENDSELECT
- '
- IF leapadd!
- INC daynum%
- ENDIF
- '
- '
- OPEN "O",#1,"*",24
- PRINT #1,""
- PRINT #1,"PlutDay V"+versnum$+" ("+versdate$+") by Peter Deane"
- PRINT #1,"Today is day number "+STR$(daynum%)+" of "+STR$(year%)
- CLOSE #1
- END
- '
-